<?php

namespace app\index\dao;

use app\common\model\LawsuitOptional;
use ShidianUtil\Thinkphp\Dao\DaoTrait;
use think\Collection;

/**
 * LawsuitOptionalDao 数据访问对象
 * Class LawsuitOptionalDao
 * @package app\index\dao
 * @method LawsuitOptional findByPK(?int $id, $field = true)
 * @method \think\Collection selectAll(?int $page, ?int $page_size, $field = true)
 * @method LawsuitOptional insertActive(array $params, array $allow_field = [])
 * @method LawsuitOptional updateActive(LawsuitOptional $model, array $params, array $allow_field = [])
 * @method LawsuitOptional findAndUpdateActive(int $id, array $params, array $allow_field = [])
 * @method LawsuitOptional updateActiveByClosure(\Closure $closure, array $params, array $allow_field = [])
 * @method void deleteModel(LawsuitOptional $model)
 * @method void deleteById(int|array|\Closure $id, bool $force = false)
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037579
 * @link https://www.kancloud.cn/manual/think-orm/1257998
 * @link https://www.kancloud.cn/thinkphp/master-database-and-model/265551
 */
class LawsuitOptionalDao
{
    use DaoTrait;

    /**
     * @var LawsuitOptional
     */
    private $baseModel;

    /**
     * LawsuitOptionalDao constructor.
     */
    public function __construct()
    {
        $this->baseModel = LawsuitOptional::class;
    }

    public function select($categoryId): Collection
    {
        return LawsuitOptional::where('categoryId', $categoryId)
            ->order('ord', 'ASC')
            ->select();
    }
}
